package com.goodmr.passport.account;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 帐号平台从属标识
 *
 * @author <a href="mailto:bingdong13@msn.com">bigo</a>
 */
@Getter
@AllArgsConstructor
public enum PrimaryEnum {

    NO(0, "关联帐号"),
    YES(1, "主帐号");

    private int value;

    private String desc;

    public static PrimaryEnum get(int value) {

        for (PrimaryEnum primaryEnum : PrimaryEnum.values()) {
            if (primaryEnum.getValue() == value) {
                return primaryEnum;
            }
        }

        return PrimaryEnum.YES;
    }
}
